home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 32 / Amiga Format AFCD32 (Nov 1998, Issue 117).iso / -seriously_amiga- / programming / other / classfree / cfbuttonclass / cfbutton.doc next >
Text File  |  1998-08-10  |  4KB  |  136 lines

  1. Class:                  CFbuttonclass
  2. Author:                 Anders E. Andersen <andersa@fys.ku.dk>
  3. Superclass:             gadgetclass
  4. Desciption:             GadTools button gadget replacement
  5. Include File:           "CDbutton.h"
  6.  
  7.  
  8.  
  9. New Methods:
  10. ------------
  11.  
  12. None
  13.  
  14.  
  15. Changed Methods:
  16. ----------------
  17.  
  18. GM_HITTEST - Allways returns GMR_GADGETHIT
  19.  
  20. GM_GOACTIVE - Sets gadget flag GFLG_SELECTED, renders
  21. gadget and returns GMR_MEACTIVE.
  22.  
  23. GM_HANDLEINPUT - Handles gadget rendering according to
  24. mouse movements, checks for gadget abort in two ways,
  25. MENUDOWN and SELECTUP with mousepointer outside gadget.
  26. Also checks for GACT_RELVERIFY to see if IDCMP_GADGETUP
  27. should be sent. It clears GFLG_SELECTED when mouse is
  28. outside the select box and sets it again if the mouse
  29. reenters the select box.
  30. As long as GFLG_SELECTED is set the object sends itself
  31. OM_NOTIFY messages for every IECLASS_TIMER event that
  32. GM_HANDLEINPUT gets. For all these messages the
  33. OPUF_INTERIM flag is set in opu_Flags and the GA_ID
  34. attribute is in opu_AttrList.
  35.  
  36.  
  37. GM_GOINACTIVE - If GFLG_SELECTED is set, it clears it,
  38. renders the gadget and sends itself an OM_NOTIFY message
  39. with OPUF_INTERIM cleared and the GA_ID attribute in
  40. opu_AttrList.
  41.  
  42.  
  43. Attributes:
  44. -----------
  45.  
  46.  All attributes are passed directly to gadgetclass. The
  47. following attributes are used by CFbuttonclass:
  48.  
  49. GA_Left, GA_Top, GA_Width, GA_Height
  50.  
  51.  Positions and sizes the button.
  52.  
  53.  
  54. GA_Text
  55.  
  56.  NULL terminated C string. See CFBU_Layout for display control.
  57.  
  58.  
  59. GA_Image
  60.  
  61.  Excepts a plain Intuition or custom (BOOPSI) image object as
  62. data value. It is sent to the superclass, which means the value
  63. is stored in Gadget.GadgetRender.
  64.  Positioning depends on the CFBU_Layout attribute.
  65.  
  66.  
  67. GA_RelVerify
  68.  
  69.  Determines if IDCMP_GADGETUP messages should be sent.
  70.  
  71.  
  72. GA_Border
  73.  
  74.  Boolean. If TRUE, 3D button edges are drawn. If FALSE,
  75. the drawing pass is skipped entirely (no fill!).
  76.  GA_Image and GA_Text still works though.
  77.  Defaults to TRUE. Overrides the gadgetclass definition.
  78.  
  79.  
  80. GA_Highlight
  81.  
  82.  Boolean. If TRUE, the gadget internals are complemented
  83. when selected. Actually it is filled with FILLPEN. If FALSE,
  84. the gadget is just drawn as being down.
  85.  If GA_Border is set to false, this attribute is ignored.
  86.  Defaults to TRUE. Overrides the gadgetclass definition.
  87.  
  88.  
  89. CFBU_Layout
  90.  
  91.  Takes various flags as the data argument. With this attribute
  92. it is possible to have easy control over image and text
  93. positioning in the button.
  94.  
  95.  The flags are:
  96.  
  97.  LAYOUT_AUTO     - No flags set. Text is centered and image
  98.                    is positioned via its own LeftEdge and
  99.                    TopEdge attributes (IA_Left and IA_Top).
  100.  
  101.  LAYOUT_TXTLEFT  -
  102.  LAYOUT_TXTRIGHT - Left/right justifies the button text.
  103.  
  104.  LAYOUT_IMGABOVE - This will change the images LeftEdge and
  105.                    TopEdge values (IA_Left and IA_Top) to
  106.                    position the image in the top-center of the
  107.                    button.
  108.                    If a text label is given, it is automatically
  109.                    positioned at the bottom of the button.
  110.  
  111.  LAYOUT_IMGBELOW - This flag works just opposide of
  112.                    LAYOUT_IMGABOVE and is overrided if that
  113.                    flag is set.
  114.  
  115.  LAYOUT_IMGLEFT  -
  116.  LAYOUT_IMGRIGHT - Together with LAYOUT_IMGABOVE or
  117.                    LAYOUT_IMGBELOW these flags move the image
  118.                    to the far left or right instead of centering
  119.                    them. The image is still positioned in the top
  120.                    or buttom of the gadget.
  121.                    If LAYOUT_IMGABOVE or LAYOUT_IMGBELOW is not
  122.                    set the the image is left or right justified
  123.                    but centered in the button. This will also
  124.                    position the text in the empty space to the
  125.                    right of the image if LAYOUT_IMGLEFT is set
  126.                    and to the left of the image if
  127.                    LAYOUT_IMGRIGHT is set. The text can still be
  128.                    left or right justified or it can remain
  129.                    centered in this space. An example of how this
  130.                    works can be seen in the CFpumbutton.gadget.
  131.                    The triangle image is given via GA_Image, and
  132.                    CFBU_Layout has LAYOUT_IMGLEFT|LAYOUT_TXTLEFT
  133.                    set.
  134.  
  135.  
  136.